package com.sdk.es.http.gen;

/**
 * @author limaosheng
 * @create 2023-08-31 17:11
 * @desc
 */
public class CheckDif {

    public static void main(String[] args) {
        check();
    }
    public static final String index = "";
    public static final String str1 = "";
    public static final String str2 = "";

    private static void check() {
        //校验index_20*索引的字段是否包含index的所有字段
        String[] arr = index.split("\n\n");
        StringBuffer sb1 = new StringBuffer();
        for(String s : arr){
            if(s.contains(".keyword")){
                continue;
            }
            if(!str1.contains(s) && !str2.contains(s)){
                System.out.println("index有index_20*没有的字段:" + s.replace("\n", ","));
                sb1.append(s + "\n\n");
            }
        }
        System.out.println("----------------------分割线---------------------");
        System.out.println(sb1);
        System.out.println("----------------------分割线---------------------");
        //校验index是否包含index_20*索引的所有字段
        String[] arr1 = str1.split("\n\n");
        String[] arr2 = str2.split("\n\n");
        StringBuffer sb2 = new StringBuffer();
        for(String s : arr1){
            if(s.contains(".keyword")){
                continue;
            }
            if(!index.contains(s)){
                System.out.println("index_20*有index没有的字段:" + s.replace("\n", ","));
                sb2.append(s + "\n\n");
            }
        }
        for(String s : arr2){
            if(s.contains(".keyword")){
                continue;
            }
            if(!index.contains(s)){
                System.out.println("index_20*有index没有的字段:" + s.replace("\n", ","));
                sb2.append(s + "\n\n");
            }
        }
        System.out.println("----------------------分割线---------------------");
        System.out.println(sb2);
        System.out.println("----------------------分割线---------------------");
    }
}
